<?php
/**
 * User: Administrator
 * Time: 2015/10/27 10:34
 */

function MaxLayerOfArray($arr) {
	$count = 0;
	foreach($arr as $v){
		if(is_array($v)){

		}
	}
	return $count;
}

$arr = array(
	'js'  => [
		'hahy' => [
		],
		'dsds'=>[
			'sdsd'=>[]
		]
	],
);

function array_depth($array) {
	if(!is_array($array)) return 0;
	$max_depth = 1;
	foreach ($array as $value) {
		if (is_array($value)) {
			$depth = array_depth($value) + 1;
			if ($depth > $max_depth) {
				$max_depth = $depth;
			}
		}
	}
	return $max_depth;
}

echo array_depth($arr);

//var_dump(MaxLayerOfArray($arr));